# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=emacs-srv
pkgver=0.2
pkgrel=0
_pkgreal=srv
pkgdesc="Elisp library to perform SRV DNS requests"
url="https://github.com/legoscia/srv.el"
arch="noarch"
license="GPL-2.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox"
source="https://github.com/legoscia/srv.el/archive/$pkgver/emacs-srv-$pkgver.tar.gz
	optional-dns.el.patch
	"
builddir="$srcdir/srv.el-$pkgver"
options="!check" # no tests provided

build() {
	emacs -batch -q -no-site-file -L . \
		-eval '(setq byte-compile-error-on-warn t)' \
		-f batch-byte-compile \
		./*.el
}

package() {
	install -Dvm644 ./*.el ./*.elc \
		-t "$pkgdir"/usr/share/emacs/site-lisp/

	cd "$pkgdir"/usr/share/emacs/site-lisp
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
f2378e78d241e13b857330f57031936773f0c45377898456b7ffc4fce81bcea1f8969318020f4c6b52f56cf87406cbface415d59d586cbe2b745a2edfc689ee9  emacs-srv-0.2.tar.gz
818343236430be0c1959fd62d75b636a08977632a733b3ee0f6c060621576bedf7f9e323337929ddcfac3b6ff50e64567a4eb666da7bede3561349b5236d9e04  optional-dns.el.patch
"
